#pragma once
#include "../LibDGGSBase/DGGSDefine.hpp"

_NNU_DGGS_BEGIN
using namespace Base;

/// <summary>
/// 格网系统的几何类型
/// </summary>
enum DGGSGeometryType { ST_Point, ST_PolyLine, ST_Polygon,ST_Unknown };

namespace Feature
{
	/// <summary>
	/// 格网系统的几何结构
	/// </summary>
	class DGGSGeometry
	{
    protected:
		DGGSGeometryType _shapeType = ST_Unknown;       //几何类型

        DGGSElementCode* _gridData= nullptr;            //格网单元数据

        int _gridCount=0;                               //格网数据量

	public:
		DGGSGeometry(void) { }

        /// <summary>
        /// 获取格网几何类型
        /// </summary>
        DGGSGeometryType getShapeType() { return _shapeType; }

        /// <summary>
        /// 深拷贝
        /// </summary>
		virtual DGGSGeometry* deepCopy() = 0;

        /// <summary>
        /// 设置格网数据
        /// </summary>
        /// <param name="srcData">格网数据</param>
        virtual bool setGridData(DGGSElementCode* srcData)=0;

        /// <summary>
        /// 设置格网数据
        /// </summary>
        /// <param name="srcCode">格网数据</param>
        virtual void addGridCode(DGGSElementCode srcCode)=0;


        /// <summary>
        /// 设置网格数量
        /// </summary>
        /// <param name="gridCount">网格数量</param>
        virtual void setGridCount(int gridCount)=0;

        /// <summary>
        /// 获取网格数据
        /// </summary>
        /// <param name="tagData">格网数据</param>
        virtual bool getGridData(DGGSElementCode* &tagData)=0;

        /// <summary>
        /// 获取单个网格数据
        /// </summary>
        /// <param name="index">格网索引</param>
        virtual DGGSElementCode getGridCodeByIndex(int index) = 0;

        /// <summary>
        /// 获取网格数量
        /// </summary>
        virtual int getGridCount()=0;

        /// <summary>
        /// 判断是否相同
        /// </summary>
        /// <param name="other">另外一个Geometry</param>
        virtual bool Equals( DGGSGeometry *other)=0;

        bool operator==(DGGSGeometry& other) {return this->Equals(&other);}

        virtual ~DGGSGeometry() = default;  // 虚析构函数
	};

};



_NNU_DGGS_END